Skip to content

build: Disable Android debug variants outside the sample app - #5824

Closed
runningcode wants to merge 1 commit into
mainfrom
no/disable-debug-test-variants
Closed

build: Disable Android debug variants outside the sample app#5824
runningcode wants to merge 1 commit into
mainfrom
no/disable-debug-test-variants

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

📜 Description

Unit tests already run against the release variant (testBuildType = "release"), and CI already disabled the Android debug variant. This makes the same thing happen locally:

  • Config.Android.shouldSkipDebugVariant now skips the debug variant everywhere (not just in CI), so local builds of the libraries and integration-test apps match CI and no longer configure/build the unused debug variant.
  • The sample app (sentry-samples-android) keeps both debug and release variants locally and in CI, so manual runs and btrace profiling (installDebug) still work.
  • Updated the contributor docs (AGENTS.md, .cursor/rules/coding.mdc) and the test skill to reference testReleaseUnitTest instead of testDebugUnitTest.
  • Refreshed the now-stale "CI disables the debug variant" comments in the Android module build files and simplified the snapshot-outputs task matcher in sentry-android-core to the release task.

💡 Motivation and Context

All unit tests use the release variant, so the debug variant only added build/configuration overhead locally, and the docs pointed contributors (and agents) at a testDebugUnitTest task that no longer runs.

💚 How did you test it?

  • ./gradlew :sentry-android-core:tasks --all — only testReleaseUnitTest is present; no assembleDebug/testDebugUnitTest.
  • ./gradlew :sentry-samples:sentry-samples-android:tasks --all — both installDebug/assembleDebug and their release counterparts remain.
  • ./gradlew spotlessApply apiDump — passes with no API changes.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

#skip-changelog

Unit tests already target the release variant (testBuildType = release)
and CI disabled the debug variant. Disable the debug variant locally too
so local builds match CI and skip building the unused variant. The
sample app keeps both variants for manual runs and profiling.

Update the contributor docs and test skill to reference
testReleaseUnitTest instead of testDebugUnitTest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@runningcode
runningcode marked this pull request as ready for review July 23, 2026 08:23

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 50cdc0a. Configure here.

// variant, so building the debug variant would only add overhead.
fun shouldSkipDebugVariant(name: String?): Boolean {
return System.getenv("CI")?.toBoolean() ?: false && name == "debug"
return name == "debug"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample debug variant resolution broken

High Severity

shouldSkipDebugVariant now always disables library debug variants, while sentry-samples-android still builds debug and depends on those projects (including via debugImplementation). The sample debug build type has no matchingFallbacks to release, so installDebug/assembleDebug can fail variant-aware dependency resolution.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 50cdc0a. Configure here.

@runningcode
runningcode marked this pull request as draft July 23, 2026 08:47
@sentry

sentry Bot commented Jul 23, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.50.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 318.87 ms 365.35 ms 46.48 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
22f4345 325.23 ms 454.66 ms 129.43 ms
22f4345 312.78 ms 347.40 ms 34.62 ms
8558cac 306.16 ms 355.24 ms 49.09 ms
bb0ff41 317.76 ms 384.66 ms 66.90 ms
7c1a728 289.46 ms 368.15 ms 78.69 ms
d501a7e 314.55 ms 343.34 ms 28.79 ms
4fc476b 280.63 ms 363.04 ms 82.42 ms
6727e14 337.22 ms 373.94 ms 36.71 ms
ae7fed0 293.84 ms 380.22 ms 86.38 ms
ee747ae 400.46 ms 423.61 ms 23.15 ms

App size

Revision Plain With Sentry Diff
22f4345 1.58 MiB 2.29 MiB 719.83 KiB
22f4345 1.58 MiB 2.29 MiB 719.83 KiB
8558cac 0 B 0 B 0 B
bb0ff41 0 B 0 B 0 B
7c1a728 0 B 0 B 0 B
d501a7e 0 B 0 B 0 B
4fc476b 0 B 0 B 0 B
6727e14 1.58 MiB 2.28 MiB 718.64 KiB
ae7fed0 1.58 MiB 2.12 MiB 551.77 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB

Previous results on branch: no/disable-debug-test-variants

Startup times

Revision Plain With Sentry Diff
43e7331 362.69 ms 437.89 ms 75.20 ms

App size

Revision Plain With Sentry Diff
43e7331 0 B 0 B 0 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant